﻿
function NemoScroller() {
    this.TopSpace = 0;
};

NemoScroller.prototype.Init = function () {
    this.UI = new Object();
    this.UI.AlwaysTop = $('#scrollAlwaysTop');
    this.UI.SrollPane = $('#scrollMakeScroll');
};
NemoScroller.prototype.Load = function () {
    var windowHeight = $(window).height();
    this.TopSpace = this.UI.AlwaysTop.height();
    this.UI.AlwaysTop.css({
        position: 'fixed',
        top: '0',
        left: '0',
        width: '100%'
    });
    this.UI.SrollPane.css({
        marginTop: this.TopSpace + 'px',
        height: (windowHeight - this.TopSpace) + 'px',
        overflow: 'auto'
    });
    //$('body').css('height', 'auto');

    var scroller = this;
    $(window).resize(function () {
        scroller.AreaResized();
    });
    this.UI.SrollPane.jScrollPane({
        autoReinitialise: true
    });
};
NemoScroller.prototype.AreaResized = function () {
    var windowHeight = $(window).height();
    this.UI.SrollPane.height(windowHeight - this.TopSpace);
};
var scroller = new NemoScroller();
window.Nemo.RegisterController(scroller);
window.Nemo.Scroller = scroller;